package com.springboot.fwwb09.controller;

import com.springboot.fwwb09.entity.users;
import com.springboot.fwwb09.service.usersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("yhcx")
@CrossOrigin
public class usersController {

    @Autowired
    private usersService usersService;

    @GetMapping("findAll")
    public List<users> findAll() {
        List<users> users = usersService.findAll();
        return users;

    }

}
